<?php

namespace common\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "{{%signup}}".
 *
 * @property int $id
 * @property int $cid
 * @property string $name
 * @property string $id_card
 * @property string $tel
 * @property string $addr
 * @property int $created_at
 * @property int $updated_at
 */
class Signup extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%signup}}';
    }

    // 行为
    public function behaviors()
    {
        return [
          [ 'class' => TimestampBehavior::className()]
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['cid', 'name', 'tel'], 'required'],
            [['cid'], 'integer'],
            [['name', 'tel'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'cid' => '课程',
            'name' => '姓名',
            'tel' => '手机',
            'created_at' => '报名时间',
            'updated_at' => '更新时间',
        ];
    }
}
